package service.impl;

import dao.StudentDao;
import domain.Student;
import service.IStudentService;

import java.sql.SQLException;
import java.util.List;

/**
 * @author 于金鹏
 * @Date 2024/12/12 16:23
 * @Package yujinpeng
 */
public class IStudentServiceImpl implements IStudentService {

    private StudentDao studentDao;

    public IStudentServiceImpl(StudentDao studentDao) {
        this.studentDao = studentDao;
    }

    @Override
    public List<Student> getStudents(Student student) throws SQLException {
        return studentDao.list(student);
    }

    @Override
    public int addStudent(Student student) throws SQLException {
        return studentDao.addStudent(student);
    }

    @Override
    public int deleteStudent(int id) throws SQLException {
       return studentDao.deleteStudent(id);
    }

    @Override
    public int updateStudent(Student student) throws SQLException {
        return studentDao.updateStudent(student);
    }
}
